\(\int x^3 (a+b \tan (c+d x^2)) \, dx\) [1]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 73 \[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\frac {a x^4}{4}+\frac {1}{4} i b x^4-\frac {b x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{2 d}+\frac {i b \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d x^2\right )}\right )}{4 d^2} \]

[Out]

1/4*a*x^4+1/4*I*b*x^4-1/2*b*x^2*ln(1+exp(2*I*(d*x^2+c)))/d+1/4*I*b*polylog(2,-exp(2*I*(d*x^2+c)))/d^2

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {14, 3832, 3800, 2221, 2317, 2438} \[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\frac {a x^4}{4}+\frac {i b \operatorname {PolyLog}\left (2,-e^{2 i \left (d x^2+c\right )}\right )}{4 d^2}-\frac {b x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{2 d}+\frac {1}{4} i b x^4 \]

[In]

Int[x^3*(a + b*Tan[c + d*x^2]),x]

[Out]

(a*x^4)/4 + (I/4)*b*x^4 - (b*x^2*Log[1 + E^((2*I)*(c + d*x^2))])/(2*d) + ((I/4)*b*PolyLog[2, -E^((2*I)*(c + d*
x^2))])/d^2

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3800

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x
] - Dist[2*I, Int[(c + d*x)^m*(E^(2*I*(e + f*x))/(1 + E^(2*I*(e + f*x)))), x], x] /; FreeQ[{c, d, e, f}, x] &&
 IGtQ[m, 0]

Rule 3832

Int[(x_)^(m_.)*((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Tan[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \int \left (a x^3+b x^3 \tan \left (c+d x^2\right )\right ) \, dx \\ & = \frac {a x^4}{4}+b \int x^3 \tan \left (c+d x^2\right ) \, dx \\ & = \frac {a x^4}{4}+\frac {1}{2} b \text {Subst}\left (\int x \tan (c+d x) \, dx,x,x^2\right ) \\ & = \frac {a x^4}{4}+\frac {1}{4} i b x^4-(i b) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x}{1+e^{2 i (c+d x)}} \, dx,x,x^2\right ) \\ & = \frac {a x^4}{4}+\frac {1}{4} i b x^4-\frac {b x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{2 d}+\frac {b \text {Subst}\left (\int \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,x^2\right )}{2 d} \\ & = \frac {a x^4}{4}+\frac {1}{4} i b x^4-\frac {b x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{2 d}-\frac {(i b) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i \left (c+d x^2\right )}\right )}{4 d^2} \\ & = \frac {a x^4}{4}+\frac {1}{4} i b x^4-\frac {b x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{2 d}+\frac {i b \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d x^2\right )}\right )}{4 d^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00 \[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\frac {a x^4}{4}+\frac {1}{4} i b x^4-\frac {b x^2 \log \left (1+e^{2 i \left (c+d x^2\right )}\right )}{2 d}+\frac {i b \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d x^2\right )}\right )}{4 d^2} \]

[In]

Integrate[x^3*(a + b*Tan[c + d*x^2]),x]

[Out]

(a*x^4)/4 + (I/4)*b*x^4 - (b*x^2*Log[1 + E^((2*I)*(c + d*x^2))])/(2*d) + ((I/4)*b*PolyLog[2, -E^((2*I)*(c + d*
x^2))])/d^2

Maple [F]

\[\int x^{3} \left (a +b \tan \left (d \,x^{2}+c \right )\right )d x\]

[In]

int(x^3*(a+b*tan(d*x^2+c)),x)

[Out]

int(x^3*(a+b*tan(d*x^2+c)),x)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (56) = 112\).

Time = 0.27 (sec) , antiderivative size = 155, normalized size of antiderivative = 2.12 \[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\frac {2 \, a d^{2} x^{4} - 2 \, b d x^{2} \log \left (-\frac {2 \, {\left (i \, \tan \left (d x^{2} + c\right ) - 1\right )}}{\tan \left (d x^{2} + c\right )^{2} + 1}\right ) - 2 \, b d x^{2} \log \left (-\frac {2 \, {\left (-i \, \tan \left (d x^{2} + c\right ) - 1\right )}}{\tan \left (d x^{2} + c\right )^{2} + 1}\right ) - i \, b {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (d x^{2} + c\right ) - 1\right )}}{\tan \left (d x^{2} + c\right )^{2} + 1} + 1\right ) + i \, b {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (d x^{2} + c\right ) - 1\right )}}{\tan \left (d x^{2} + c\right )^{2} + 1} + 1\right )}{8 \, d^{2}} \]

[In]

integrate(x^3*(a+b*tan(d*x^2+c)),x, algorithm="fricas")

[Out]

1/8*(2*a*d^2*x^4 - 2*b*d*x^2*log(-2*(I*tan(d*x^2 + c) - 1)/(tan(d*x^2 + c)^2 + 1)) - 2*b*d*x^2*log(-2*(-I*tan(
d*x^2 + c) - 1)/(tan(d*x^2 + c)^2 + 1)) - I*b*dilog(2*(I*tan(d*x^2 + c) - 1)/(tan(d*x^2 + c)^2 + 1) + 1) + I*b
*dilog(2*(-I*tan(d*x^2 + c) - 1)/(tan(d*x^2 + c)^2 + 1) + 1))/d^2

Sympy [F]

\[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\int x^{3} \left (a + b \tan {\left (c + d x^{2} \right )}\right )\, dx \]

[In]

integrate(x**3*(a+b*tan(d*x**2+c)),x)

[Out]

Integral(x**3*(a + b*tan(c + d*x**2)), x)

Maxima [F]

\[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\int { {\left (b \tan \left (d x^{2} + c\right ) + a\right )} x^{3} \,d x } \]

[In]

integrate(x^3*(a+b*tan(d*x^2+c)),x, algorithm="maxima")

[Out]

1/4*a*x^4 + 2*b*integrate(x^3*sin(2*d*x^2 + 2*c)/(cos(2*d*x^2 + 2*c)^2 + sin(2*d*x^2 + 2*c)^2 + 2*cos(2*d*x^2
+ 2*c) + 1), x)

Giac [F]

\[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\int { {\left (b \tan \left (d x^{2} + c\right ) + a\right )} x^{3} \,d x } \]

[In]

integrate(x^3*(a+b*tan(d*x^2+c)),x, algorithm="giac")

[Out]

integrate((b*tan(d*x^2 + c) + a)*x^3, x)

Mupad [B] (verification not implemented)

Time = 0.48 (sec) , antiderivative size = 155, normalized size of antiderivative = 2.12 \[ \int x^3 \left (a+b \tan \left (c+d x^2\right )\right ) \, dx=\frac {a\,x^4}{4}-\frac {b\,\left (\pi \,\ln \left (\cos \left (d\,x^2\right )\right )+2\,c\,\ln \left ({\mathrm {e}}^{-d\,x^2\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+1\right )-\pi \,\ln \left ({\mathrm {e}}^{-d\,x^2\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+1\right )-\ln \left (\cos \left (d\,x^2+c\right )\right )\,\left (2\,c-\pi \right )-\pi \,\ln \left ({\mathrm {e}}^{d\,x^2\,2{}\mathrm {i}}+1\right )+\mathrm {polylog}\left (2,-{\mathrm {e}}^{-d\,x^2\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}\right )\,1{}\mathrm {i}+d^2\,x^4\,1{}\mathrm {i}+2\,d\,x^2\,\ln \left ({\mathrm {e}}^{-d\,x^2\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+1\right )+c\,d\,x^2\,2{}\mathrm {i}\right )}{4\,d^2} \]

[In]

int(x^3*(a + b*tan(c + d*x^2)),x)

[Out]

(a*x^4)/4 - (b*(2*c*log(exp(-d*x^2*2i)*exp(-c*2i) + 1) - pi*log(exp(-d*x^2*2i)*exp(-c*2i) + 1) + pi*log(cos(d*
x^2)) - log(cos(c + d*x^2))*(2*c - pi) - pi*log(exp(d*x^2*2i) + 1) + polylog(2, -exp(-d*x^2*2i)*exp(-c*2i))*1i
 + d^2*x^4*1i + 2*d*x^2*log(exp(-d*x^2*2i)*exp(-c*2i) + 1) + c*d*x^2*2i))/(4*d^2)